﻿using SaaS.Model.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using XCore.Domain.Entities;
using XCore.Domain.Enums;

namespace SaaS.Model.Entity.Sites
{
    [Table("Site_AdminLogs")]
    public class SiteAdminLog : IEntity<int>
    {
        [Column("LogId")]
        public int Id { get; set; }
        /// <summary>
        /// 站点Id
        /// </summary>
        public int SiteId { get; set; }
        /// <summary>
        /// 管理员Id
        /// </summary>
        public int AdminId { get; set; }
        /// <summary>
        /// 目标Id 操作某条数据
        /// </summary>
        public int TargetId { get; set; }
        /// <summary>
        /// 日志来源
        /// </summary>
        public AdminLoggerSource Source { get; set; }
        /// <summary>
        /// 系统类型
        /// </summary>
        public SystemType Type { get; set; }
        /// <summary>
        /// 执行耗时
        /// </summary>
        public int Duration { get; set; }
        /// <summary>
        /// 消息
        /// </summary>
        [StringLength(1024)]
        public string Message { get; set; }
        /// <summary>
        /// 数据 Json格式
        /// </summary>
        public string CustomData { get; set; }
        /// <summary>
        /// 请求信息包含头信息
        /// </summary>
        public string RequestInfo { get; set; }
        /// <summary>
        /// 记录时间
        /// </summary>
        public DateTime CreationTime { get; set; }
        /// <summary>
        /// 创建IP
        /// </summary>
        [StringLength(32)]
        public string IP { get; set; }
    }
}
